/*
 * Planner.hpp
 *
 *  Created on: Aug 26, 2009
 *      Author: naveenoid
 */

#ifndef PLANNER_HPP_
#define PLANNER_HPP_

#include "./../MainLoop/Loop.hpp"
#include "./../ToolKit/Log/Logger.hpp"
#include <ecl/threads.hpp>
#include <vector>

using Octopus::MainLoop::Loop;
using Octopus::ToolKit::Log::Logger;
using ECL::Threads::Mutex;
using std::vector;



namespace Octopus {

namespace Trajectory {


class Planner {
public:
	static Planner * getInstance(Loop * = NULL, Logger* =NULL);
	void remove(void);

	void start(void);
	bool stop(void);

	bool finished(void);

	bool setFixedPoint(double);

private:

	double fixedPoint;

	static Planner *planner;

	vector<double> setPoints;

	Mutex mutex;
	Mutex fixedPointMutex;

	Loop * loop;
	Logger *logger;

	bool continueLoop;
	bool loopFinished;

	bool setPointsChanged;

	Planner(Loop* = NULL, Logger* = NULL);
	virtual ~Planner();
};

}

}

#endif /* PLANNER_HPP_ */
